zabbix_agent_install:
  cmd.run:
    - cwd: /tmp
    - names:
      - yum -y install zabbix-agent
    - unless: test -d /etc/zabbix

zabbix_agent_conf:
  file.managed:
    - name: /etc/zabbix/zabbix_agentd.conf
    - source: salt://zabbix_agent/file/zabbix_agentd.conf
    - requires:
      - cmd.run: zabbix_agent_install

zabbix_agent_service:
  cmd.run:
    - names:
      - /sbin/chkconfig zabbix-agent on
    - unless: /sbin/chkconfig --list zabbix-agent
    - requires:
      - file: zabbix_agent_conf


